
import 'package:flutter/material.dart';
import '../index.dart';


Map routes = {
  '/': (context) => const HomePage(),
};

var onGenerateRoute = (RouteSettings setting) {
  final String? name = setting.name;
  final Function? pageContentBuilder = routes[name];
  if (pageContentBuilder != null) {
    if (setting.arguments != null) {
      final Route route = MaterialPageRoute(
          builder: (context) =>
              pageContentBuilder(context, argument: setting.arguments));
      return route;
    } else {
      final Route route =
      MaterialPageRoute(builder: (context) => pageContentBuilder(context));
      return route;
    }
  }
  return null;
};
